Remote Sensing Index · Urban
UI – Urban Index
Built-up / Impervious Surfaces
The Urban Index (UI) is a spectral index designed to enhance and map
urban & built-up areas by exploiting the contrast between
SWIR and NIR reflectance.
1 · Concept & formula
What is the Urban Index (UI)?
The Urban Index is a two-band spectral index that takes advantage of the fact that
built-up surfaces reflect more strongly in the SWIR region than in the NIR,
while vegetation exhibits the opposite behaviour.
Mathematical Expression
In normalized form, UI is commonly expressed as:
UI = (SWIR − NIR) / (SWIR + NIR)
For common sensors:
- Sentinel-2:
UI = (B12 − B8) / (B12 + B8)
- Landsat 8/9:
UI = (B6 − B5) / (B6 + B5)
- Landsat 5 TM:
UI = (B7 − B4) / (B7 + B4) (original formulation)
Typical Interpretation
- High positive values → dense built-up / impervious surfaces
- Moderate values → mixed urban / bare soil
- Low or negative values → vegetation, water, or non-urban land cover
Main Applications
- Urban expansion & sprawl analysis
- Built-up density mapping
- Inputs for urban heat island and LST studies
- Change detection of impervious surfaces over time
2 · Data & practical notes
Data & Bands for UI
Recommended Sensors
-
Sentinel-2 (MSI) – 10/20 m
- NIR:
B8 (~842 nm, 10 m)
- SWIR:
B12 (~2200 nm, 20 m)
-
Landsat 8/9 OLI – 30 m
Good Practice
- Use surface reflectance products (e.g., S2_SR, LANDSAT *_SR).
- Apply cloud and shadow masking, or use a cloud percentage filter.
- Clip the result to your AOI and set a consistent date range for comparisons.
- Use thresholding or classification on UI to separate built-up vs. non-built-up classes.
Tip: Combine UI with vegetation (e.g., NDVI) and water indices
(e.g., MNDWI) to better distinguish urban areas from bare soil and wetlands.
// ---------------------------------------------
// Urban Index (UI) from Sentinel-2 SR
// UI = (SWIR - NIR) / (SWIR + NIR)
// SWIR = B12 (20 m)
// NIR = B8 (10 m)
// ---------------------------------------------
// HOW TO USE:
// 1) Draw your AOI on the map (Polygon / Rectangle).
// 2) It will appear as the variable "geometry".
// 3) Paste this code in the Earth Engine Code Editor.
// 4) Click Run to visualise UI and export GeoTIFF.
// ---------------------------------------------
// 1. Define Area of Interest (AOI)
var roi = geometry; // Drawn on the map
// 2. Define date range
var startDate = '2023-01-01';
var endDate = '2023-12-31';
// 3. Load Sentinel-2 Surface Reflectance collection
var s2 = ee.ImageCollection('COPERNICUS/S2_SR')
.filterBounds(roi)
.filterDate(startDate, endDate)
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
.median()
.clip(roi);
// 4. Select bands for UI
var nir = s2.select('B8'); // NIR (10 m)
var swir = s2.select('B12'); // SWIR (20 m)
// 5. Compute Urban Index (UI)
var ui = swir.subtract(nir)
.divide(swir.add(nir))
.rename('UI');
// 6. Visualization parameters
var uiVis = {
min: -0.5,
max: 0.5,
palette: [
'#0b1020', // very low
'#2c7bb6',
'#abd9e9',
'#ffffbf',
'#fdae61',
'#d7191c' // high urban / built-up
]
};
// 7. Center map and add layers
Map.centerObject(roi, 11);
Map.addLayer(ui, uiVis, 'Urban Index (UI)', true);
// Optionally, add a true color background
var rgb = ee.ImageCollection('COPERNICUS/S2_SR')
.filterBounds(roi)
.filterDate(startDate, endDate)
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 20))
.select(['B4','B3','B2']) // RGB
.median()
.clip(roi);
Map.addLayer(rgb, {min:0, max:3000}, 'True Color (RGB)', false);
// 8. Export UI as GeoTIFF to Google Drive
Export.image.toDrive({
image: ui,
description: 'UI_Sentinel2_Export',
fileNamePrefix: 'UI_S2',
region: roi,
scale: 10, // match NIR resolution
maxPixels: 1e13
});